<?php
/* @var $this TrMMrController */
/* @var $data TrMMr */
?>
<?php

//redirect jika sudah di set pasiennya YII::app()->session['mr_id']
if(!empty(YII::app()->session['mr_id'])){
$this->redirect(array('trMrTrans/create&v='.YII::app()->session['mr_id'])); 
}
?>
<a href="?r=fo/trMMedic/view&id=<?php echo $data->id ?>";>	
<div class="thumbnail" style="width:40%; float: left; text-align:center;">
<?php
	$strName = $data->prefix_title.' '.$data->name.' '.$data->suffix_title;
	/*if (strlen($strName) > 20)
	{
		$pointName = strlen($strName) - 3;
		while (strlen($strName) > 20)
		{
			$strName = $data->prefix_title.' '.substr($data->name,0,$pointName).'... '.$data->suffix_title;
			$pointName--;
		}
	}*/
	/*$arrJadwals = $data->trMMedicSch;
	usort($arrJadwals, 'sortByHari');
	$array_hari = array(1=>"Sen","Sel","Rab","Kam","Jum", "Sab","Ming"); 
	$arrJadwal = array();
	$arrHari = array();
	$arrKeterangan = array();
	$arrIDPoli = array();
	foreach ($arrJadwals as $dokter_jwd){
		$arrJadwal[] = $array_hari[$dokter_jwd->hari].' ['.date('H:i',  strtotime($dokter_jwd->start))
				.'~'.date('H:i', strtotime($dokter_jwd->end)).']';
		$arrHari[] = $dokter_jwd->hari;
		$arrKeterangan[] = $dokter_jwd->ket;
		$arrIDPoli[] = $dokter_jwd->layanan_id;
		/*echo $array_hari[$dokter_jwd->hari].' ['.date('H:i',  strtotime($dokter_jwd->start))
				.'~'.date('H:i', strtotime($dokter_jwd->end)).']<br>';*/
	/*  }
	$firstIndex = 0;
	for ($i=0;$i<count($arrHari);$i++)
	{
		if ($arrHari[$i] >= date("w"))
		{
			$firstIndex = $i;
			break;
		}
	}
	*/
	//if (count($arrKeterangan) > 0) $strKet = $arrKeterangan[$firstIndex]; else $strKet = '';
?>
<b><br><?php echo CHtml::encode($strName); ?></b><br />
<small>Antrian : .../<?php #echo $data->countPasien();?></small>
<br>
<?php
/*
foreach($data->trMDokterProfiles as $profile){
	if( $profile->profile->id == 27) echo 'HP : ' . $profile->isi.'<br>';
	if( $profile->profile->id == 67) echo '<small style="color:red">' . $profile->isi.'</small><br>';
}
*/
?>
        <?php 		
/*    
    $arrJadwalSort = array();
        $arrKeteranganSort = array();
        $arrIDPoliSort = array();
        if ($firstIndex > 0)
        {
			for ($i=$firstIndex;$i<count($arrJadwal);$i++) $arrJadwalSort[] = $arrJadwal[$i];
			for ($i=0;$i<$firstIndex;$i++) $arrJadwalSort[] = $arrJadwal[$i];
			for ($i=$firstIndex;$i<count($arrKeterangan);$i++) $arrKeteranganSort[] = $arrKeterangan[$i];
			for ($i=0;$i<$firstIndex;$i++) $arrKeteranganSort[] = $arrKeterangan[$i];
			for ($i=$firstIndex;$i<count($arrIDPoli);$i++) $arrIDPoliSort[] = $arrIDPoli[$i];
			for ($i=0;$i<$firstIndex;$i++) $arrIDPoliSort[] = $arrIDPoli[$i];
		} else
		{
			$arrJadwalSort = $arrJadwal;
			$arrKeteranganSort = $arrKeterangan;
			$arrIDPoliSort = $arrIDPoli;
		}
        while (count($arrJadwalSort) < 7) $arrJadwalSort[] = '&nbsp';
        while (count($arrKeteranganSort) < 7) $arrKeteranganSort[] = '&nbsp';
        while (count($arrIDPoliSort) < 7) $arrIDPoliSort[] = '&nbsp';
        array_splice($arrJadwalSort,3);
        array_splice($arrKeteranganSort,3);
        array_splice($arrIDPoliSort,3);
        for($i=0;$i<count($arrJadwalSort);$i++)
        {
			echo $arrJadwalSort[$i];
			echo " ";
			echo $arrKeteranganSort[$i];
			echo " - ";
			echo $arrIDPoliSort[$i];
			echo "<br>";
		}
*/        //echo CHtml::dropDownList('jadwal',0,$arrJadwal);
        ?>  </small>
	<br>
	<br>
</div>

</a>

